//
//  ViewController.m
//  SocketIOOCDemo
//
//  Created by YangWei on 2021/6/20.
//  Copyright © 2021 YangWei. All rights reserved.
//

#import "ViewController.h"
#import "SocketIOOCDemo-Swift.h"

@interface ViewController ()

@property (nonatomic, strong) TestDemo *demo;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initUI];
    
    self.demo = [[TestDemo alloc] init];
    [self.demo startConnect];
}

- (void)initUI
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(100, 100, 100, 60);
    [button setTitle:@"send" forState:UIControlStateNormal];
    [button setBackgroundColor:[UIColor orangeColor]];
    [button addTarget:self action:@selector(sendMsg) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:button];
}

- (void)sendMsg
{
    [self.demo sendMessage];
}

@end
